using ProjectScheduling.models;

namespace ProjectScheduling
{
    internal static class Program
    {
        /// <summary>
        ///  The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            ApplicationConfiguration.Initialize();
            Application.Run(LoginForm.b);
            //Application.Run(new LoginForm());
        }

        public static Users? LoginUser { get; set; } = null;
        public static void ShowFormDialog<T>(T form)
            where T : Form
        {
            if (form.Visible)
            {
                form.Visible = false;
            }
            form.Show();
        }
        public static (Color back, Color fore) GetColorByState(int state)
        {
            return state switch
            {
                1 => (Color.Pink, Color.Black),
                2 => (Color.Yellow, Color.Black),
                4 => (Color.Blue, Color.Yellow),
                8 => (Color.Green, Color.White),
                16 => (Color.LightGray, Color.Black),
                _ => (Color.LightGray, Color.Black),
            };
        }
    }
}